package lc.二叉树.剑指Offer;

import utils.TreeNode;

/**
 * @description: 二叉树的镜像
 * @author: qian
 * @createDate: 2021/8/31
 */
public class JzOfferMain27 {

    class Solution {
        public TreeNode mirrorTree(TreeNode root) {

            if(root == null) {
                return null;
            }
            TreeNode temp = new TreeNode();
            temp = root.left;
            root.left = root.right;
            root.right = temp;
            mirrorTree(root.left);
            mirrorTree(root.right);
            return root;

        }
    }
}
